//
//  GHRecomendTableViewCell.m
//  GodHorses
//
//  Created by Mac on 2017/11/21.
//  Copyright © 2017年 stoneobs@icloud.com. All rights reserved.
//

#import "GHGiveTableViewCell.h"
@interface GHGiveTableViewCell()
@property(nonatomic, strong) STLabel                     *typeLable;
@property(nonatomic, strong) STLabel                     *timeLable;
@property(nonatomic, strong) STLabel                     *monyeLable;


@end
@implementation GHGiveTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 60;
}
#pragma mark --subView
- (void)configSubView{
    
    self.backgroundColor = [UIColor whiteColor];
    
    self.typeLable  = [[STLabel alloc] initWithFrame:CGRectMake(10, 10, 200, 20)
                                                     text:@"--"
                                                textColor:GH_secendTextColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.typeLable];
    
    self.timeLable  = [[STLabel alloc] initWithFrame:CGRectMake(10, self.typeLable.bottom, 300, 20)
                                                text:@"--"
                                           textColor:GH_secendTextColor
                                                font:15
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.timeLable];
    
    self.monyeLable  = [[STLabel alloc] initWithFrame:CGRectMake(10, self.typeLable.bottom, 300, 20)
                                                text:@"--"
                                           textColor:GH_YellowBackGroundColor
                                                font:15
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentRight];
    self.monyeLable.right = UIScreenWidth - 10;
    self.monyeLable.centerY = [GHGiveTableViewCell cellHeight]/2;
    [self addSubview:self.monyeLable];
    
}


- (void)setModel:(GHGiveModel *)model{
    _model = model;
    
    self.typeLable.text = model.typeString;
    
    NSDate * date = [NSDate dateWithTimeIntervalSince1970:[model.create_time integerValue]].st_localDate;
    self.timeLable.text = date.st_yyyyMMddhhmmssWithDate;
    
    self.monyeLable.text = [NSString stringWithFormat:@"+%@",model.change_amount];
}

@end

